package com.zhang.authoritycenter.common.model.dto.sys;


import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.zhang.sharding.model.KingHoodDefaultSort;
import com.zhang.sharding.model.KingPageReqDTO;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Collections;
import java.util.List;


@Setter
@Getter
public class DirectionReqExtDTO extends KingPageReqDTO implements KingHoodDefaultSort, Serializable {
    private static final long serialVersionUID = 1L;
    public static final String DEFAULT_COLUMN = "createTime";

    private Long id;
    /**
     * 数据key
     */
    private String dataKey;
    /**
     * 数据编码
     */
    private String dataCode;
    /**
     * 父ID
     */
    private Long pId;
    /**
     * 数据名称值
     */
    private String dataValue;

    private Integer status;
    /**
     * 排序字段
     */
    private Integer sortNumber;

    /**
     * 字典code列表
     */
    @NotNull(message = "字典code不能为空")
    private List<String> dataCodeList;
    /**
     * 归属类型（0：组织中心，1，商品中心）
     */
    private String belongType;
    /**
     * 数据名称
     */
    private String dataName;

    @Override
    public List<OrderItem> getDefaultSort() {
        OrderItem one = OrderItem.desc(DEFAULT_COLUMN);
        return Collections.singletonList(one);
    }

    @Override
    public List<OrderItem> getTailSort() {
        return Collections.emptyList();
    }
}